/*
 * @Descripttion: 
 * @version: 
 * @Author: lsy
 * @Date: 2021-12-08 08:59:29
 * @LastEditors: lsy
 * @LastEditTime: 2021-12-16 17:34:00
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/Home/index.vue')
  },
  {
    path: '/home/:clientType',
    name: 'clientHome',
    component: () => import('@/views/clientHome/index.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/404.vue')
  },
  {
    path: "*", // 此处需特别注意置于最底部
    redirect: "/404"
  }
]

const router = new VueRouter({
  routes
})
const VueRouterPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => {
    console.log(err)
  })
}
export default router
